package com.gnerv.battle.boot.project.guard.model.bo;

import com.gnerv.battle.boot.common.tools.DateTimeTools;
import com.gnerv.battle.boot.project.guard.model.entity.MonitorHost;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class MonitorHostBO {

    private String ukId;
    private String name;
    private String host;
    private Integer port;
    private String username;
    private String password;
    private String status;
    private Integer sort;

    public MonitorHost toCreateMonitorHost() {
        MonitorHost monitorHost = new MonitorHost();
        BeanUtils.copyProperties(this, monitorHost);
        monitorHost.setGmtCreate(DateTimeTools.currentTimeMillis());
        monitorHost.setGmtModified(DateTimeTools.currentTimeMillis());
        return monitorHost;
    }

    public MonitorHost toUpdateMonitorHost() {
        MonitorHost monitorHost = new MonitorHost();
        BeanUtils.copyProperties(this, monitorHost);
        monitorHost.setGmtModified(DateTimeTools.currentTimeMillis());
        return monitorHost;
    }

}

